#include "logger.h"

Logger::Logger(QObject *parent) : QObject(parent)
{

}

Logger &Logger::getSingleton()
{
    static Logger log;
    return log;
}


Logger &Logger::operator<<(const QString &info)
{
    if(callbackFunc){
        callbackFunc(info);
    }
    return *this;
}

const std::function<void(QString)> &Logger::getCallbackFunc() const
{
    return callbackFunc;
}

void Logger::setCallbackFunc(const std::function<void(QString)> &newCallbackFunc)
{
    callbackFunc = newCallbackFunc;
}
